//
//  CNComitOrderTableViewCell.m
//  BeeQuick_19
//
//  Created by 赵玉忠 on 16/9/23.
//  Copyright © 2016年 CN Team. All rights reserved.
//

#import "CNComitOrderTableViewCell.h"
#import "CNPayTypeModel.h"
@interface CNComitOrderTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *LeftImageIcon;
@property (weak, nonatomic) IBOutlet UILabel *PayTypeName;
@property (weak, nonatomic) IBOutlet UIImageView *RightImageIcon;


@end

@implementation CNComitOrderTableViewCell

-(void)setModel:(CNPayTypeModel *)model{
    _model = model;
    self.LeftImageIcon.image = [UIImage imageNamed:model.LeftImageIcon];
    self.RightImageIcon.image = [UIImage imageNamed:model.RightImageIcon];
    self.PayTypeName.text = model.PayType;
}

-(void)loadJpgImage:(NSString *)jpgImagePath{
    self.LeftImageIcon.image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:jpgImagePath ofType:nil]];
}
- (IBAction)buttonClick:(id)sender {
    for (int i=0; i<self.modelArray.count; i++) {
        CNPayTypeModel *model = self.modelArray[i];
        if (i == self.indexPath.row-1) {
            model.RightImageIcon = @"v2_selected";
        }else{
            model.RightImageIcon = @"v2_noselected";
        }
    }
    self.block();
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
